#ifndef DIR_H
#define DIR_H

class PathName;

class PLIBEXP Directory
{
	public:
		static bool8 getCurrent(PathName& Result);

		// make:		does not create intermediate dirs
		// makeAll:		creates any intermediate dirs
		//
		// Both are successful when the directory already exists.
		//
		enum EndOpt
		{
			EndIsDirectory,		// every word on the path is a directory
			EndIsFilename		// last word on path is a filename (ignore it)
		};
		static bool8 make(const PathName& Path);
		static bool8 makeAll(const PathName& Path, EndOpt = EndIsDirectory);

		// remove:		not recursive; only successful when dir is empty
		// removeAll:	recursive; destroys all files and dirs within Path
		//
		// Both are successful when the directory doesn't exist.
		//
		static bool8 remove(const PathName& Path);
		static bool8 removeAll(const PathName& Path);

		// move:			moves src (dir or file) to dest (same type as src)
		// moveContents:	moves src contents (not src dir itself) to dest dir
		//
		// Both fail if src or dest do not already exist
		//
		static bool8 move(const PathName& Src, const PathName& Dest);
		static bool8 copy(const PathName& Src, const PathName& Dest);
		static bool8 moveContents(const PathName& Src, const PathName& Dest, int32* errCode=0);
		static bool8 copyContents(const PathName& Src, const PathName& Dest, int32* errCode=0);

		static bool8 isDirectory(const PathName& Src);

		static const String::Character sep;	// platform-specific directory separator
};

#endif